package com.gitee.dolt.security.model;

import cn.hutool.core.lang.Dict;

import java.util.Collections;
import java.util.List;

/**
 * @author LYH
 */
public class SysUser extends Dict {
    /**
     * 用户id
     */
    public Long getId() {
        return getLong("id");
    }

    public SysUser setId(String id) {
        return (SysUser) set("id", id);
    }

    public String getIdStr() {
        return getStr("id");
    }

    public SysUser setId(Long id) {
        return (SysUser) set("id", id);
    }

    /**
     * 用户账号
     */
    public String getAccount() {
        return getStr("account");
    }

    public SysUser setAccount(String account) {
        return (SysUser) set("account", account);
    }

    /**
     * 姓名
     */
    public String getName() {
        return getStr("name");
    }

    public SysUser setName(String name) {
        return (SysUser) set("name", name);
    }

    /**
     * 作用范围，不同范围的用户使用的加密密钥不相同
     */
    public String getScope() {
        return getStr("scope");
    }

    public SysUser setScope(String scope) {
        return (SysUser) set("scope", scope);
    }

    /**
     * 角色资源
     */
    public List<String> getRoles() {
        return get("roles", Collections.emptyList());
    }

    public SysUser setRoles(List<String> roles) {
        return (SysUser) set("roles", roles);
    }

    /**
     * 权限资源
     */
    public List<String> getResources() {
        return get("resources", Collections.emptyList());
    }

    public SysUser setResources(List<String> resources) {
        return (SysUser) set("resources", resources);
    }


}
